
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>2.深度优先搜索算法 · 计算机 ,java , 大数据 基础知识体系</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="hzh">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchors/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-toggle-chapters/toggle.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-back-to-top-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-pro/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-pageview-count/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    

        
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="2.深度优先搜索题目集.html" />
    
    
    <link rel="prev" href="1.时间复杂度.html" />
    

    
    
    
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        <li class="header">操作系统</li>
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../操作系统/1.基本概述.html">
            
                <a href="../操作系统/1.基本概述.html">
            
                    
                    1.操作系统基本概述
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../操作系统/2.进程管理之进程与线程.html">
            
                <a href="../操作系统/2.进程管理之进程与线程.html">
            
                    
                    2.进程管理之进程与线程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../操作系统/3.进程管理之处理机调度.html">
            
                <a href="../操作系统/3.进程管理之处理机调度.html">
            
                    
                    3.进程管理之处理机调度
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../操作系统/4.进程管理之进程同步.html">
            
                <a href="../操作系统/4.进程管理之进程同步.html">
            
                    
                    4.进程管理之进程同步
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../操作系统/5.内存管理之基本概念.html">
            
                <a href="../操作系统/5.内存管理之基本概念.html">
            
                    
                    5.内存管理之基本概念
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../操作系统/6.内存管理之虚拟内存.html">
            
                <a href="../操作系统/6.内存管理之虚拟内存.html">
            
                    
                    6.内存管理之虚拟内存
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../操作系统/7.IO设备管理之基本概念.html">
            
                <a href="../操作系统/7.IO设备管理之基本概念.html">
            
                    
                    7.IO设备管理之基本概念
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../操作系统/8.面试题总结一.html">
            
                <a href="../操作系统/8.面试题总结一.html">
            
                    
                    8.面试题总结一
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">计算机网络篇</li>
        
        
    
        <li class="chapter " data-level="2.1" data-path="../计算机网络/1.计算机网络入门基础概念.html">
            
                <a href="../计算机网络/1.计算机网络入门基础概念.html">
            
                    
                    1.计算机网络入门文章(必读)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="../计算机网络/2.计算机网络通信基础.html">
            
                <a href="../计算机网络/2.计算机网络通信基础.html">
            
                    
                    2.计算机网络通信入门文章(必读)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="../计算机网络/3.数据链路层.html">
            
                <a href="../计算机网络/3.数据链路层.html">
            
                    
                    3.数据链路层
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="../计算机网络/4.网络层1.html">
            
                <a href="../计算机网络/4.网络层1.html">
            
                    
                    4.网络层(一)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="../计算机网络/5.网络层2.html">
            
                <a href="../计算机网络/5.网络层2.html">
            
                    
                    5.网络层(二)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="../计算机网络/6.传输层.html">
            
                <a href="../计算机网络/6.传输层.html">
            
                    
                    6.传输层
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.7" data-path="../计算机网络/7.应用层.html">
            
                <a href="../计算机网络/7.应用层.html">
            
                    
                    7.应用层(⭐)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.8" data-path="../计算机网络/10.HTTP相关协议.html">
            
                <a href="../计算机网络/10.HTTP相关协议.html">
            
                    
                    8.HTTP相关及发展
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.9" >
            
                <span>
            
                    
                    9.websocket
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="2.10" data-path="../计算机网络/9.面试题二.html">
            
                <a href="../计算机网络/9.面试题二.html">
            
                    
                    面试题总结一
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">数据结构篇</li>
        
        
    
        <li class="chapter " data-level="3.1" data-path="../数据结构/1.图论.html">
            
                <a href="../数据结构/1.图论.html">
            
                    
                    1.图论
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="../数据结构/2.图论例题.html">
            
                <a href="../数据结构/2.图论例题.html">
            
                    
                    2.图论例题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="../数据结构/3.散列表.html">
            
                <a href="../数据结构/3.散列表.html">
            
                    
                    3.散列表
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="../数据结构/4.排序算法.html">
            
                <a href="../数据结构/4.排序算法.html">
            
                    
                    4.排序算法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="../数据结构/5.排序列题.html">
            
                <a href="../数据结构/5.排序列题.html">
            
                    
                    5.排序算法例题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="../数据结构/6.树论.html">
            
                <a href="../数据结构/6.树论.html">
            
                    
                    6.树论
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.7" data-path="../数据结构/7.树论例题.html">
            
                <a href="../数据结构/7.树论例题.html">
            
                    
                    7.树论例题.md
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.8" data-path="../数据结构/9.模板.html">
            
                <a href="../数据结构/9.模板.html">
            
                    
                    数据结构模板
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">算法篇</li>
        
        
    
        <li class="chapter " data-level="4.1" data-path="leetCode周赛题解.html">
            
                <a href="leetCode周赛题解.html">
            
                    
                    leetCode周赛记录
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="1.时间复杂度.html">
            
                <a href="1.时间复杂度.html">
            
                    
                    1.时间复杂度
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="4.3" data-path="2.深度优先搜索.html">
            
                <a href="2.深度优先搜索.html">
            
                    
                    2.深度优先搜索算法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.4" data-path="2.深度优先搜索题目集.html">
            
                <a href="2.深度优先搜索题目集.html">
            
                    
                    2.深搜题目集
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.5" data-path="3.广度优先搜索.html">
            
                <a href="3.广度优先搜索.html">
            
                    
                    3.广度优先搜索算法
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">JVM篇</li>
        
        
    
        <li class="chapter " data-level="5.1" data-path="../jvm/1.jvm内存结构.html">
            
                <a href="../jvm/1.jvm内存结构.html">
            
                    
                    1.jvm内存结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="../jvm/2.HotSpot虚拟机对象探秘.html">
            
                <a href="../jvm/2.HotSpot虚拟机对象探秘.html">
            
                    
                    2.HotSpot虚拟机对象探秘.md
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.3" data-path="../jvm/3.对象存亡与垃圾收集算法.html">
            
                <a href="../jvm/3.对象存亡与垃圾收集算法.html">
            
                    
                    3.对象存亡与垃圾收集算法.md
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.4" data-path="../jvm/4.HotSpot的算法细节与垃圾收集器.html">
            
                <a href="../jvm/4.HotSpot的算法细节与垃圾收集器.html">
            
                    
                    4.HotSpot的算法细节与垃圾收集器.md
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.5" data-path="../jvm/5.内存分配与回收策略.html">
            
                <a href="../jvm/5.内存分配与回收策略.html">
            
                    
                    5.内存分配与回收策略.md
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.6" data-path="../jvm/6.类文件结构.html">
            
                <a href="../jvm/6.类文件结构.html">
            
                    
                    6.类文件结构.md
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.7" data-path="../jvm/7.类加载机制.html">
            
                <a href="../jvm/7.类加载机制.html">
            
                    
                    7.类加载机制.md
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="5.8" data-path="../jvm/8.jvm逃逸分析.html">
            
                <a href="../jvm/8.jvm逃逸分析.html">
            
                    
                    8.逃逸分析技术
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">多线程篇</li>
        
        
    
        <li class="chapter " data-level="6.1" data-path="../多线程/basic/0.多线程路线图.html">
            
                <a href="../多线程/basic/0.多线程路线图.html">
            
                    
                    1.多线程学习路线图
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.2" data-path="../多线程/basic/0.java内存模型与线程.html">
            
                <a href="../多线程/basic/0.java内存模型与线程.html">
            
                    
                    2.java内存模型与线程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.3" data-path="../多线程/3.并行程序基础.html">
            
                <a href="../多线程/3.并行程序基础.html">
            
                    
                    2.并行程序基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.4" data-path="../多线程/basic/0.jhappenBefore与jvm指令重排.html">
            
                <a href="../多线程/basic/0.jhappenBefore与jvm指令重排.html">
            
                    
                    3.happenBefore与jvm指令重排序
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.5" data-path="../多线程/basic/1.synchronized与volatile.html">
            
                <a href="../多线程/basic/1.synchronized与volatile.html">
            
                    
                    4.synchronized与volatile.md
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.6" data-path="../多线程/basic/2.ThreadLocal.html">
            
                <a href="../多线程/basic/2.ThreadLocal.html">
            
                    
                    5.ThreadLocal.md
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.7" data-path="../多线程/cas/1.乐观锁与悲观锁.html">
            
                <a href="../多线程/cas/1.乐观锁与悲观锁.html">
            
                    
                    6.乐观锁与悲观锁.md
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.8" data-path="../多线程/cas/2.CAS与atomic类.html">
            
                <a href="../多线程/cas/2.CAS与atomic类.html">
            
                    
                    7.CAS与atomic类.md
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.9" data-path="../多线程/aqs/1.AQS.html">
            
                <a href="../多线程/aqs/1.AQS.html">
            
                    
                    8.AQS.md
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.10" data-path="../多线程/aqs/2.基于AQS的并发工具.html">
            
                <a href="../多线程/aqs/2.基于AQS的并发工具.html">
            
                    
                    9.基于AQS的并发工具.md
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.11" data-path="../多线程/blockingQueue/1.阻塞队列.html">
            
                <a href="../多线程/blockingQueue/1.阻塞队列.html">
            
                    
                    10.阻塞队列.md
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.12" data-path="../多线程/pond/1.线程池与底层原理.html">
            
                <a href="../多线程/pond/1.线程池与底层原理.html">
            
                    
                    11.线程池与底层原理.md
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.13" data-path="../多线程/10面试题一.html">
            
                <a href="../多线程/10面试题一.html">
            
                    
                    12.面试题一
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.14" data-path="../多线程/10面试题二.html">
            
                <a href="../多线程/10面试题二.html">
            
                    
                    13.面试题二.md
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">java集合篇</li>
        
        
    
        <li class="chapter " data-level="7.1" data-path="../basic/collection/1.java集合.html">
            
                <a href="../basic/collection/1.java集合.html">
            
                    
                    1.集合架构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.2" data-path="../basic/collection/2.HashMap源码分析.html">
            
                <a href="../basic/collection/2.HashMap源码分析.html">
            
                    
                    2.hashMap底层原理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.3" data-path="../basic/collection/3.ConcurrentHashMap分析.html">
            
                <a href="../basic/collection/3.ConcurrentHashMap分析.html">
            
                    
                    3.ConcurrentHashMap分析
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">设计模式篇</li>
        
        
    
        <li class="chapter " data-level="8.1" >
            
                <span>
            
                    
                    1.创造型模式
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="8.2" data-path="../设计模式/factory/三种工厂模式介绍.html">
            
                <a href="../设计模式/factory/三种工厂模式介绍.html">
            
                    
                    三种工厂模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="8.3" data-path="../设计模式/factory/实战工厂模式.html">
            
                <a href="../设计模式/factory/实战工厂模式.html">
            
                    
                    实战工厂模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="8.4" data-path="../设计模式/factory/实战抽象工厂模式.html">
            
                <a href="../设计模式/factory/实战抽象工厂模式.html">
            
                    
                    实战抽象工厂模式
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">mysql篇</li>
        
        
    
        <li class="chapter " data-level="9.1" data-path="../数据库/mysql/1.b树b+树的底层原理.html">
            
                <a href="../数据库/mysql/1.b树b+树的底层原理.html">
            
                    
                    1.mysql索引基础之b树与b+树⭐⭐
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="9.2" data-path="../数据库/mysql/2.mysql索引.html">
            
                <a href="../数据库/mysql/2.mysql索引.html">
            
                    
                    2.mysql索引及优化⭐⭐⭐⭐
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="9.3" data-path="../数据库/mysql/3.mysql存储引擎.html">
            
                <a href="../数据库/mysql/3.mysql存储引擎.html">
            
                    
                    3.mysql存储引擎.md
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="9.4" data-path="../数据库/mysql/4.多版本并发控制之mvcc原理.html">
            
                <a href="../数据库/mysql/4.多版本并发控制之mvcc原理.html">
            
                    
                    4.多版本并发控制之mvcc原理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="9.5" data-path="../数据库/mysql/4.mysql事务.html">
            
                <a href="../数据库/mysql/4.mysql事务.html">
            
                    
                    5.mysql事务
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="9.6" data-path="../数据库/mysql/5.mysql锁机制.html">
            
                <a href="../数据库/mysql/5.mysql锁机制.html">
            
                    
                    6.mysql的锁机制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="9.7" data-path="../数据库/mysql/6.mysql面试题一.html">
            
                <a href="../数据库/mysql/6.mysql面试题一.html">
            
                    
                    7.mysql面试题一
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">高并发中间件篇</li>
        
        
    

    
        
        <li class="header">架构理论篇</li>
        
        
    
        <li class="chapter " data-level="11.1" data-path="../架构/0.架构演进.html">
            
                <a href="../架构/0.架构演进.html">
            
                    
                    1.架构演进
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="11.2" data-path="../架构/0.微服务架构与soa架构.html">
            
                <a href="../架构/0.微服务架构与soa架构.html">
            
                    
                    2.微服务架构与soa架构
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">高可用系统篇</li>
        
        
    
        <li class="chapter " data-level="12.1" data-path="../高可用架构/1.限流.html">
            
                <a href="../高可用架构/1.限流.html">
            
                    
                    1.系统限流
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="12.2" data-path="../高可用系统/2.服务熔断.html">
            
                <a href="../高可用系统/2.服务熔断.html">
            
                    
                    2.服务熔断
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="12.3" data-path="../高可用系统/3.服务降级.html">
            
                <a href="../高可用系统/3.服务降级.html">
            
                    
                    3.服务降级
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">spring-cloud 微服务篇</li>
        
        
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >2.深度优先搜索算法</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-navicon"></i><ul><ul><li><span class="title-icon "></span><a href="#&#x4E00;-&#x7B97;&#x6CD5;&#x6846;&#x67B6;"><b></b>&#x4E00; &#x7B97;&#x6CD5;&#x6846;&#x67B6;</a></li><li><span class="title-icon "></span><a href="#&#x4E8C;-&#x95EE;&#x9898;&#x4E3E;&#x4F8B;"><b></b>&#x4E8C; &#x95EE;&#x9898;&#x4E3E;&#x4F8B;</a></li><ul><li><span class="title-icon "></span><a href="#1&#x5168;&#x6392;&#x5217;&#x95EE;&#x9898;"><b></b>1.&#x5168;&#x6392;&#x5217;&#x95EE;&#x9898;</a></li><li><span class="title-icon "></span><a href="#2n&#x7687;&#x540E;&#x95EE;&#x9898;"><b></b>2.N&#x7687;&#x540E;&#x95EE;&#x9898;</a></li></ul><li><span class="title-icon "></span><a href="#&#x4E09;-&#x5206;&#x7C7B;&#x9898;&#x578B;"><b></b>&#x4E09; &#x5206;&#x7C7B;&#x9898;&#x578B;</a></li><ul><li><span class="title-icon "></span><a href="#1&#x6392;&#x5217;&#x7EC4;&#x5408;&#x7C7B;&#x578B;"><b></b>1.&#x6392;&#x5217;,&#x7EC4;&#x5408;&#x7C7B;&#x578B;</a></li><li><span class="title-icon "></span><a href="#2&#x89E3;&#x6570;&#x72EC;&#x8FD4;&#x56DE;&#x4E00;&#x6B21;&#x7C7B;&#x578B;"><b></b>2.&#x89E3;&#x6570;&#x72EC;:&#x8FD4;&#x56DE;&#x4E00;&#x6B21;&#x7C7B;&#x578B;</a></li></ul></ul></ul></div><a href="#" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><h2 id="&#x4E00;-&#x7B97;&#x6CD5;&#x6846;&#x67B6;"><a name="&#x4E00;-&#x7B97;&#x6CD5;&#x6846;&#x67B6;" class="anchor-navigation-ex-anchor" href="#&#x4E00;-&#x7B97;&#x6CD5;&#x6846;&#x67B6;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x4E00;-&#x7B97;&#x6CD5;&#x6846;&#x67B6;" class="plugin-anchor" href="#&#x4E00;-&#x7B97;&#x6CD5;&#x6846;&#x67B6;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x4E00; &#x7B97;&#x6CD5;&#x6846;&#x67B6;</h2>
<p><strong>&#x89E3;&#x51B3;&#x4E00;&#x4E2A;&#x56DE;&#x6EAF;&#x95EE;&#x9898;&#xFF0C;&#x5B9E;&#x9645;&#x4E0A;&#x5C31;&#x662F;&#x4E00;&#x4E2A;&#x51B3;&#x7B56;&#x6811;&#x7684;&#x904D;&#x5386;&#x8FC7;&#x7A0B;</strong>&#x3002;&#x4F60;&#x53EA;&#x9700;&#x8981;&#x601D;&#x8003; 3 &#x4E2A;&#x95EE;&#x9898;&#xFF1A;</p>
<p>1&#x3001;&#x8DEF;&#x5F84;&#xFF1A;&#x4E5F;&#x5C31;&#x662F;&#x5DF2;&#x7ECF;&#x505A;&#x51FA;&#x7684;&#x9009;&#x62E9;&#x3002;</p>
<p>2&#x3001;&#x9009;&#x62E9;&#x5217;&#x8868;&#xFF1A;&#x4E5F;&#x5C31;&#x662F;&#x4F60;&#x5F53;&#x524D;&#x53EF;&#x4EE5;&#x505A;&#x7684;&#x9009;&#x62E9;&#x3002;</p>
<p>3&#x3001;&#x7ED3;&#x675F;&#x6761;&#x4EF6;&#xFF1A;&#x4E5F;&#x5C31;&#x662F;&#x5230;&#x8FBE;&#x51B3;&#x7B56;&#x6811;&#x5E95;&#x5C42;&#xFF0C;&#x65E0;&#x6CD5;&#x518D;&#x505A;&#x9009;&#x62E9;&#x7684;&#x6761;&#x4EF6;&#x3002;</p>
<p>&#x5982;&#x679C;&#x4F60;&#x4E0D;&#x7406;&#x89E3;&#x8FD9;&#x4E09;&#x4E2A;&#x8BCD;&#x8BED;&#x7684;&#x89E3;&#x91CA;&#xFF0C;&#x6CA1;&#x5173;&#x7CFB;&#xFF0C;&#x6211;&#x4EEC;&#x540E;&#x9762;&#x4F1A;&#x7528;&#x300C;&#x5168;&#x6392;&#x5217;&#x300D;&#x548C;&#x300C;N &#x7687;&#x540E;&#x95EE;&#x9898;&#x300D;&#x8FD9;&#x4E24;&#x4E2A;&#x7ECF;&#x5178;&#x7684;&#x56DE;&#x6EAF;&#x7B97;&#x6CD5;&#x95EE;&#x9898;&#x6765;&#x5E2E;&#x4F60;&#x7406;&#x89E3;&#x8FD9;&#x4E9B;&#x8BCD;&#x8BED;&#x662F;&#x4EC0;&#x4E48;&#x610F;&#x601D;&#xFF0C;&#x73B0;&#x5728;&#x4F60;&#x5148;&#x7559;&#x7740;&#x5370;&#x8C61;&#x3002;</p>
<p>&#x4EE3;&#x7801;&#x65B9;&#x9762;&#xFF0C;&#x56DE;&#x6EAF;&#x7B97;&#x6CD5;&#x7684;&#x6846;&#x67B6;&#xFF1A;</p>
<pre><code>result = []
def backtrack(&#x8DEF;&#x5F84;, &#x9009;&#x62E9;&#x5217;&#x8868;):
    if &#x6EE1;&#x8DB3;&#x7ED3;&#x675F;&#x6761;&#x4EF6;:
        result.add(&#x8DEF;&#x5F84;)
        return

    for &#x9009;&#x62E9; in &#x9009;&#x62E9;&#x5217;&#x8868;:
        &#x505A;&#x9009;&#x62E9;
        backtrack(&#x8DEF;&#x5F84;, &#x9009;&#x62E9;&#x5217;&#x8868;)
        &#x64A4;&#x9500;&#x9009;&#x62E9;
</code></pre><p><strong>&#x5176;&#x6838;&#x5FC3;&#x5C31;&#x662F; for &#x5FAA;&#x73AF;&#x91CC;&#x9762;&#x7684;&#x9012;&#x5F52;&#xFF0C;&#x5728;&#x9012;&#x5F52;&#x8C03;&#x7528;&#x4E4B;&#x524D;&#x300C;&#x505A;&#x9009;&#x62E9;&#x300D;&#xFF0C;&#x5728;&#x9012;&#x5F52;&#x8C03;&#x7528;&#x4E4B;&#x540E;&#x300C;&#x64A4;&#x9500;&#x9009;&#x62E9;&#x300D;</strong>&#xFF0C;&#x7279;&#x522B;&#x7B80;&#x5355;&#x3002;</p>
<p>&#x4EC0;&#x4E48;&#x53EB;&#x505A;&#x9009;&#x62E9;&#x548C;&#x64A4;&#x9500;&#x9009;&#x62E9;&#x5462;&#xFF0C;&#x8FD9;&#x4E2A;&#x6846;&#x67B6;&#x7684;&#x5E95;&#x5C42;&#x539F;&#x7406;&#x662F;&#x4EC0;&#x4E48;&#x5462;&#xFF1F;&#x4E0B;&#x9762;&#x6211;&#x4EEC;&#x5C31;&#x901A;&#x8FC7;&#x300C;&#x5168;&#x6392;&#x5217;&#x300D;&#x8FD9;&#x4E2A;&#x95EE;&#x9898;&#x6765;&#x89E3;&#x5F00;&#x4E4B;&#x524D;&#x7684;&#x7591;&#x60D1;&#xFF0C;&#x8BE6;&#x7EC6;&#x63A2;&#x7A76;&#x4E00;&#x4E0B;&#x5176;&#x4E2D;&#x7684;&#x5965;&#x5999;&#xFF01;</p>
<h2 id="&#x4E8C;-&#x95EE;&#x9898;&#x4E3E;&#x4F8B;"><a name="&#x4E8C;-&#x95EE;&#x9898;&#x4E3E;&#x4F8B;" class="anchor-navigation-ex-anchor" href="#&#x4E8C;-&#x95EE;&#x9898;&#x4E3E;&#x4F8B;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x4E8C;-&#x95EE;&#x9898;&#x4E3E;&#x4F8B;" class="plugin-anchor" href="#&#x4E8C;-&#x95EE;&#x9898;&#x4E3E;&#x4F8B;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x4E8C; &#x95EE;&#x9898;&#x4E3E;&#x4F8B;</h2>
<h3 id="1&#x5168;&#x6392;&#x5217;&#x95EE;&#x9898;"><a name="1&#x5168;&#x6392;&#x5217;&#x95EE;&#x9898;" class="anchor-navigation-ex-anchor" href="#1&#x5168;&#x6392;&#x5217;&#x95EE;&#x9898;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="1&#x5168;&#x6392;&#x5217;&#x95EE;&#x9898;" class="plugin-anchor" href="#1&#x5168;&#x6392;&#x5217;&#x95EE;&#x9898;"><i class="fa fa-link" aria-hidden="true"></i></a>1.&#x5168;&#x6392;&#x5217;&#x95EE;&#x9898;</h3>
<p>&#x6211;&#x4EEC;&#x5728;&#x9AD8;&#x4E2D;&#x7684;&#x65F6;&#x5019;&#x5C31;&#x505A;&#x8FC7;&#x6392;&#x5217;&#x7EC4;&#x5408;&#x7684;&#x6570;&#x5B66;&#x9898;&#xFF0C;&#x6211;&#x4EEC;&#x4E5F;&#x77E5;&#x9053; <code>n</code> &#x4E2A;&#x4E0D;&#x91CD;&#x590D;&#x7684;&#x6570;&#xFF0C;&#x5168;&#x6392;&#x5217;&#x5171;&#x6709; n! &#x4E2A;&#x3002;</p>
<p>PS&#xFF1A;<strong>&#x4E3A;&#x4E86;&#x7B80;&#x5355;&#x6E05;&#x6670;&#x8D77;&#x89C1;&#xFF0C;&#x6211;&#x4EEC;&#x8FD9;&#x6B21;&#x8BA8;&#x8BBA;&#x7684;&#x5168;&#x6392;&#x5217;&#x95EE;&#x9898;&#x4E0D;&#x5305;&#x542B;&#x91CD;&#x590D;&#x7684;&#x6570;&#x5B57;</strong>&#x3002;</p>
<p>&#x90A3;&#x4E48;&#x6211;&#x4EEC;&#x5F53;&#x65F6;&#x662F;&#x600E;&#x4E48;&#x7A77;&#x4E3E;&#x5168;&#x6392;&#x5217;&#x7684;&#x5462;&#xFF1F;&#x6BD4;&#x65B9;&#x8BF4;&#x7ED9;&#x4E09;&#x4E2A;&#x6570; <code>[1,2,3]</code>&#xFF0C;&#x4F60;&#x80AF;&#x5B9A;&#x4E0D;&#x4F1A;&#x65E0;&#x89C4;&#x5F8B;&#x5730;&#x4E71;&#x7A77;&#x4E3E;&#xFF0C;&#x4E00;&#x822C;&#x662F;&#x8FD9;&#x6837;&#xFF1A;</p>
<p>&#x5148;&#x56FA;&#x5B9A;&#x7B2C;&#x4E00;&#x4F4D;&#x4E3A; 1&#xFF0C;&#x7136;&#x540E;&#x7B2C;&#x4E8C;&#x4F4D;&#x53EF;&#x4EE5;&#x662F; 2&#xFF0C;&#x90A3;&#x4E48;&#x7B2C;&#x4E09;&#x4F4D;&#x53EA;&#x80FD;&#x662F; 3&#xFF1B;&#x7136;&#x540E;&#x53EF;&#x4EE5;&#x628A;&#x7B2C;&#x4E8C;&#x4F4D;&#x53D8;&#x6210; 3&#xFF0C;&#x7B2C;&#x4E09;&#x4F4D;&#x5C31;&#x53EA;&#x80FD;&#x662F; 2 &#x4E86;&#xFF1B;&#x7136;&#x540E;&#x5C31;&#x53EA;&#x80FD;&#x53D8;&#x5316;&#x7B2C;&#x4E00;&#x4F4D;&#xFF0C;&#x53D8;&#x6210; 2&#xFF0C;&#x7136;&#x540E;&#x518D;&#x7A77;&#x4E3E;&#x540E;&#x4E24;&#x4F4D;&#x2026;&#x2026;</p>
<p>&#x5176;&#x5B9E;&#x8FD9;&#x5C31;&#x662F;&#x56DE;&#x6EAF;&#x7B97;&#x6CD5;&#xFF0C;&#x6211;&#x4EEC;&#x9AD8;&#x4E2D;&#x65E0;&#x5E08;&#x81EA;&#x901A;&#x5C31;&#x4F1A;&#x7528;&#xFF0C;&#x6216;&#x8005;&#x6709;&#x7684;&#x540C;&#x5B66;&#x76F4;&#x63A5;&#x753B;&#x51FA;&#x5982;&#x4E0B;&#x8FD9;&#x68F5;&#x56DE;&#x6EAF;&#x6811;&#xFF1A;</p>
<p><img src="https://gitee.com/zisuu/picture/raw/master/img/20201223092051.png" alt="image-20201223092051457"></p>
<p>&#x53EA;&#x8981;&#x4ECE;&#x6839;&#x904D;&#x5386;&#x8FD9;&#x68F5;&#x6811;&#xFF0C;&#x8BB0;&#x5F55;&#x8DEF;&#x5F84;&#x4E0A;&#x7684;&#x6570;&#x5B57;&#xFF0C;&#x5176;&#x5B9E;&#x5C31;&#x662F;&#x6240;&#x6709;&#x7684;&#x5168;&#x6392;&#x5217;&#x3002;<strong>&#x6211;&#x4EEC;&#x4E0D;&#x59A8;&#x628A;&#x8FD9;&#x68F5;&#x6811;&#x79F0;&#x4E3A;&#x56DE;&#x6EAF;&#x7B97;&#x6CD5;&#x7684;&#x300C;&#x51B3;&#x7B56;&#x6811;&#x300D;</strong>&#x3002;</p>
<p><strong>&#x4E3A;&#x5565;&#x8BF4;&#x8FD9;&#x662F;&#x51B3;&#x7B56;&#x6811;&#x5462;&#xFF0C;&#x56E0;&#x4E3A;&#x4F60;&#x5728;&#x6BCF;&#x4E2A;&#x8282;&#x70B9;&#x4E0A;&#x5176;&#x5B9E;&#x90FD;&#x5728;&#x505A;&#x51B3;&#x7B56;</strong></p>
<p><strong>&#x73B0;&#x5728;&#x53EF;&#x4EE5;&#x89E3;&#x7B54;&#x5F00;&#x5934;&#x7684;&#x51E0;&#x4E2A;&#x540D;&#x8BCD;&#xFF1A;**</strong><code>[2]</code><strong> </strong>&#x5C31;&#x662F;&#x300C;&#x8DEF;&#x5F84;&#x300D;&#xFF0C;&#x8BB0;&#x5F55;&#x4F60;&#x5DF2;&#x7ECF;&#x505A;&#x8FC7;&#x7684;&#x9009;&#x62E9;&#xFF1B;<strong>**<code>[1,3]</code></strong> <strong>&#x5C31;&#x662F;&#x300C;&#x9009;&#x62E9;&#x5217;&#x8868;&#x300D;&#xFF0C;&#x8868;&#x793A;&#x4F60;&#x5F53;&#x524D;&#x53EF;&#x4EE5;&#x505A;&#x51FA;&#x7684;&#x9009;&#x62E9;&#xFF1B;&#x300C;&#x7ED3;&#x675F;&#x6761;&#x4EF6;&#x300D;&#x5C31;&#x662F;&#x904D;&#x5386;&#x5230;&#x6811;&#x7684;&#x5E95;&#x5C42;&#xFF0C;&#x5728;&#x8FD9;&#x91CC;&#x5C31;&#x662F;&#x9009;&#x62E9;&#x5217;&#x8868;&#x4E3A;&#x7A7A;&#x7684;&#x65F6;&#x5019;</strong>&#x3002;</p>
<p>&#x5982;&#x679C;&#x660E;&#x767D;&#x4E86;&#x8FD9;&#x51E0;&#x4E2A;&#x540D;&#x8BCD;&#xFF0C;<strong>&#x53EF;&#x4EE5;&#x628A;&#x300C;&#x8DEF;&#x5F84;&#x300D;&#x548C;&#x300C;&#x9009;&#x62E9;&#x300D;&#x5217;&#x8868;&#x4F5C;&#x4E3A;&#x51B3;&#x7B56;&#x6811;&#x4E0A;&#x6BCF;&#x4E2A;&#x8282;&#x70B9;&#x7684;&#x5C5E;&#x6027;</strong>&#xFF0C;&#x6BD4;&#x5982;&#x4E0B;&#x56FE;&#x5217;&#x51FA;&#x4E86;&#x51E0;&#x4E2A;&#x8282;&#x70B9;&#x7684;&#x5C5E;&#x6027;&#xFF1A;</p>
<p><img src="https://gitee.com/zisuu/picture/raw/master/img/20201223092140.png" alt="image-20201223092140098"></p>
<p><strong>&#x6211;&#x4EEC;&#x5B9A;&#x4E49;&#x7684;</strong> <strong><code>backtrack</code></strong> <strong>&#x51FD;&#x6570;&#x5176;&#x5B9E;&#x5C31;&#x50CF;&#x4E00;&#x4E2A;&#x6307;&#x9488;&#xFF0C;&#x5728;&#x8FD9;&#x68F5;&#x6811;&#x4E0A;&#x6E38;&#x8D70;&#xFF0C;&#x540C;&#x65F6;&#x8981;&#x6B63;&#x786E;&#x7EF4;&#x62A4;&#x6BCF;&#x4E2A;&#x8282;&#x70B9;&#x7684;&#x5C5E;&#x6027;&#xFF0C;&#x6BCF;&#x5F53;&#x8D70;&#x5230;&#x6811;&#x7684;&#x5E95;&#x5C42;&#xFF0C;&#x5176;&#x300C;&#x8DEF;&#x5F84;&#x300D;&#x5C31;&#x662F;&#x4E00;&#x4E2A;&#x5168;&#x6392;&#x5217;</strong>&#x3002;</p>
<p>&#x56DE;&#x60F3;&#x6211;&#x4EEC;&#x521A;&#x624D;&#x8BF4;&#x7684;&#xFF0C;&#x300C;&#x8DEF;&#x5F84;&#x300D;&#x548C;&#x300C;&#x9009;&#x62E9;&#x300D;&#x662F;&#x6BCF;&#x4E2A;&#x8282;&#x70B9;&#x7684;&#x5C5E;&#x6027;&#xFF0C;&#x51FD;&#x6570;&#x5728;&#x6811;&#x4E0A;&#x6E38;&#x8D70;&#x8981;&#x6B63;&#x786E;&#x7EF4;&#x62A4;&#x8282;&#x70B9;&#x7684;&#x5C5E;&#x6027;&#xFF0C;&#x90A3;&#x4E48;&#x5C31;&#x8981;&#x5728;&#x8FD9;&#x4E24;&#x4E2A;&#x7279;&#x6B8A;&#x65F6;&#x95F4;&#x70B9;&#x641E;&#x70B9;&#x52A8;&#x4F5C;&#xFF1A;</p>
<p><img src="https://gitee.com/zisuu/picture/raw/master/img/20201223092229.png" alt="image-20201223092229684"></p>
<p>&#x73B0;&#x5728;&#xFF0C;&#x4F60;&#x662F;&#x5426;&#x7406;&#x89E3;&#x4E86;&#x56DE;&#x6EAF;&#x7B97;&#x6CD5;&#x7684;&#x8FD9;&#x6BB5;&#x6838;&#x5FC3;&#x6846;&#x67B6;&#xFF1F;</p>
<pre><code>for &#x9009;&#x62E9; in &#x9009;&#x62E9;&#x5217;&#x8868;:
    # &#x505A;&#x9009;&#x62E9;
    &#x5C06;&#x8BE5;&#x9009;&#x62E9;&#x4ECE;&#x9009;&#x62E9;&#x5217;&#x8868;&#x79FB;&#x9664;
    &#x8DEF;&#x5F84;.add(&#x9009;&#x62E9;)
    backtrack(&#x8DEF;&#x5F84;, &#x9009;&#x62E9;&#x5217;&#x8868;)
    # &#x64A4;&#x9500;&#x9009;&#x62E9;
    &#x8DEF;&#x5F84;.remove(&#x9009;&#x62E9;)
    &#x5C06;&#x8BE5;&#x9009;&#x62E9;&#x518D;&#x52A0;&#x5165;&#x9009;&#x62E9;&#x5217;&#x8868;
</code></pre><p><strong>&#x6211;&#x4EEC;&#x53EA;&#x8981;&#x5728;&#x9012;&#x5F52;&#x4E4B;&#x524D;&#x505A;&#x51FA;&#x9009;&#x62E9;&#xFF0C;&#x5728;&#x9012;&#x5F52;&#x4E4B;&#x540E;&#x64A4;&#x9500;&#x521A;&#x624D;&#x7684;&#x9009;&#x62E9;</strong>&#xFF0C;&#x5C31;&#x80FD;&#x6B63;&#x786E;&#x5F97;&#x5230;&#x6BCF;&#x4E2A;&#x8282;&#x70B9;&#x7684;&#x9009;&#x62E9;&#x5217;&#x8868;&#x548C;&#x8DEF;&#x5F84;&#x3002;</p>
<p>&#x4E0B;&#x9762;&#xFF0C;&#x76F4;&#x63A5;&#x770B;&#x5168;&#x6392;&#x5217;&#x4EE3;&#x7801;&#xFF1A;</p>
<pre><code class="lang-c++"><span class="hljs-built_in">vector</span>&lt;<span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt;&gt; result;
<span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt; vis;
<span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">dfs</span><span class="hljs-params">(<span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt; nums,<span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt; track,<span class="hljs-keyword">int</span> cur)</span>
</span>{
    <span class="hljs-comment">//&#x8FB9;&#x754C;</span>
    <span class="hljs-keyword">if</span>(cur==nums.size())
    {
        result.push_back(track);
        <span class="hljs-keyword">return</span>;
    }
    <span class="hljs-keyword">if</span>(cur&gt;=nums.size())<span class="hljs-keyword">return</span>;
    <span class="hljs-comment">//&#x9009;&#x62E9;&#x5217;&#x8868;</span>
    <span class="hljs-keyword">for</span>(<span class="hljs-keyword">int</span> i=<span class="hljs-number">0</span>;i&lt;nums.size();i++)
    {
        <span class="hljs-keyword">if</span>(!vis[i])
        {
            <span class="hljs-comment">//&#x505A;&#x51FA;&#x9009;&#x62E9;</span>
            vis[i]=<span class="hljs-literal">true</span>;
            track.push_back(nums[i]);
            dfs(nums,track,cur+<span class="hljs-number">1</span>);
            <span class="hljs-comment">//&#x56DE;&#x6714;</span>
            vis[i]=<span class="hljs-literal">false</span>;
            track.pop_back();
        }
    }
}
<span class="hljs-built_in">vector</span>&lt;<span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt;&gt; permute(<span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt;&amp; nums) {
    <span class="hljs-keyword">int</span> size=nums.size();
    vis=<span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt;(size,<span class="hljs-literal">false</span>);
    dfs(nums,<span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt;{},<span class="hljs-number">0</span>);
    <span class="hljs-keyword">return</span> result;
}
</code></pre>
<h3 id="2n&#x7687;&#x540E;&#x95EE;&#x9898;"><a name="2n&#x7687;&#x540E;&#x95EE;&#x9898;" class="anchor-navigation-ex-anchor" href="#2n&#x7687;&#x540E;&#x95EE;&#x9898;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="2n&#x7687;&#x540E;&#x95EE;&#x9898;" class="plugin-anchor" href="#2n&#x7687;&#x540E;&#x95EE;&#x9898;"><i class="fa fa-link" aria-hidden="true"></i></a>2.N&#x7687;&#x540E;&#x95EE;&#x9898;</h3>
<p>&#x8FD9;&#x4E2A;&#x95EE;&#x9898;&#x5F88;&#x7ECF;&#x5178;&#x4E86;&#xFF0C;&#x7B80;&#x5355;&#x89E3;&#x91CA;&#x4E00;&#x4E0B;&#xFF1A;&#x7ED9;&#x4F60;&#x4E00;&#x4E2A; N&#xD7;N &#x7684;&#x68CB;&#x76D8;&#xFF0C;&#x8BA9;&#x4F60;&#x653E;&#x7F6E; N &#x4E2A;&#x7687;&#x540E;&#xFF0C;&#x4F7F;&#x5F97;&#x5B83;&#x4EEC;&#x4E0D;&#x80FD;&#x4E92;&#x76F8;&#x653B;&#x51FB;&#x3002;</p>
<p><strong>PS&#xFF1A;&#x7687;&#x540E;&#x53EF;&#x4EE5;&#x653B;&#x51FB;&#x540C;&#x4E00;&#x884C;&#x3001;&#x540C;&#x4E00;&#x5217;&#x3001;&#x5DE6;&#x4E0A;&#x5DE6;&#x4E0B;&#x53F3;&#x4E0A;&#x53F3;&#x4E0B;&#x56DB;&#x4E2A;&#x65B9;&#x5411;&#x7684;&#x4EFB;&#x610F;&#x5355;&#x4F4D;&#x3002;</strong></p>
<p>&#x8FD9;&#x4E2A;&#x95EE;&#x9898;&#x672C;&#x8D28;&#x4E0A;&#x8DDF;&#x5168;&#x6392;&#x5217;&#x95EE;&#x9898;&#x5DEE;&#x4E0D;&#x591A;&#xFF0C;&#x51B3;&#x7B56;&#x6811;&#x7684;&#x6BCF;&#x4E00;&#x5C42;&#x8868;&#x793A;&#x68CB;&#x76D8;&#x4E0A;&#x7684;&#x6BCF;&#x4E00;&#x884C;&#xFF1B;&#x6BCF;&#x4E2A;&#x8282;&#x70B9;&#x53EF;&#x4EE5;&#x505A;&#x51FA;&#x7684;&#x9009;&#x62E9;&#x662F;&#xFF0C;&#x5728;&#x8BE5;&#x884C;&#x7684;&#x4EFB;&#x610F;&#x4E00;&#x5217;&#x653E;&#x7F6E;&#x4E00;&#x4E2A;&#x7687;&#x540E;&#x3002;</p>
<p>&#x76F4;&#x63A5;&#x5957;&#x7528;&#x6846;&#x67B6;:</p>
<pre><code class="lang-c++"><span class="hljs-keyword">int</span> size;
<span class="hljs-built_in">vector</span>&lt;<span class="hljs-built_in">vector</span>&lt;<span class="hljs-built_in">string</span>&gt;&gt; result;
<span class="hljs-function"><span class="hljs-keyword">bool</span> <span class="hljs-title">isValid</span><span class="hljs-params">(<span class="hljs-keyword">int</span> row,<span class="hljs-keyword">int</span> col,<span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt; colIndex)</span>
</span>{
    <span class="hljs-keyword">for</span>(<span class="hljs-keyword">int</span> i=<span class="hljs-number">0</span>;i&lt;row;i++)
    {
        <span class="hljs-keyword">if</span>(colIndex[i]==col|| i-colIndex[i]==row-col||i+colIndex[i]==row+col)
            <span class="hljs-keyword">return</span> <span class="hljs-literal">false</span>;
    }
    <span class="hljs-keyword">return</span> <span class="hljs-literal">true</span>;
}
<span class="hljs-comment">/**
 * 
 * @param board  &#x8BB0;&#x5F55;&#x68CB;&#x76D8;
 * @param colIndex &#x8BB0;&#x5F55;&#x6BCF;&#x884C;&#x7684;&#x5217;&#x6570;
 * @param row &#x5F53;&#x524D;&#x884C;
 */</span>
<span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">dfs</span><span class="hljs-params">(<span class="hljs-built_in">vector</span>&lt;<span class="hljs-built_in">string</span>&gt; board,<span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt; colIndex,<span class="hljs-keyword">int</span> row)</span>
</span>{
    <span class="hljs-comment">//&#x8FB9;&#x754C;</span>
    <span class="hljs-keyword">if</span>(row == size)
    {
        result.push_back(board);
    }
    <span class="hljs-keyword">if</span>(row &gt;= size)
        <span class="hljs-keyword">return</span>;
    <span class="hljs-comment">//&#x9009;&#x62E9;&#x5217;&#x8868;</span>
    <span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> i = <span class="hljs-number">0</span>; i &lt; size; ++i) {
        <span class="hljs-keyword">if</span>(isValid(row,i,colIndex))
        {
            <span class="hljs-comment">//&#x9009;&#x62E9;</span>
            board[row][i]=<span class="hljs-string">&apos;Q&apos;</span>;
            colIndex[row]=i;
            dfs(board,colIndex,row+<span class="hljs-number">1</span>);
            <span class="hljs-comment">//&#x56DE;&#x6714;</span>
            colIndex[row]=<span class="hljs-number">-1</span>;
            board[row][i]=<span class="hljs-string">&apos;.&apos;</span>;
        }
    }
}
<span class="hljs-built_in">vector</span>&lt;<span class="hljs-built_in">vector</span>&lt;<span class="hljs-built_in">string</span>&gt;&gt; solveNQueens(<span class="hljs-keyword">int</span> n) {
    size=n;
    <span class="hljs-built_in">vector</span>&lt;<span class="hljs-built_in">string</span>&gt; board(n,<span class="hljs-built_in">string</span>(n,<span class="hljs-string">&apos;.&apos;</span>));
    dfs(board,<span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt;(n,<span class="hljs-number">-1</span>),<span class="hljs-number">0</span>);
    <span class="hljs-keyword">return</span> result;
}
</code></pre>
<h2 id="&#x4E09;-&#x5206;&#x7C7B;&#x9898;&#x578B;"><a name="&#x4E09;-&#x5206;&#x7C7B;&#x9898;&#x578B;" class="anchor-navigation-ex-anchor" href="#&#x4E09;-&#x5206;&#x7C7B;&#x9898;&#x578B;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="&#x4E09;-&#x5206;&#x7C7B;&#x9898;&#x578B;" class="plugin-anchor" href="#&#x4E09;-&#x5206;&#x7C7B;&#x9898;&#x578B;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x4E09; &#x5206;&#x7C7B;&#x9898;&#x578B;</h2>
<h3 id="1&#x6392;&#x5217;&#x7EC4;&#x5408;&#x7C7B;&#x578B;"><a name="1&#x6392;&#x5217;&#x7EC4;&#x5408;&#x7C7B;&#x578B;" class="anchor-navigation-ex-anchor" href="#1&#x6392;&#x5217;&#x7EC4;&#x5408;&#x7C7B;&#x578B;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="1&#x6392;&#x5217;&#x7EC4;&#x5408;&#x7C7B;&#x578B;" class="plugin-anchor" href="#1&#x6392;&#x5217;&#x7EC4;&#x5408;&#x7C7B;&#x578B;"><i class="fa fa-link" aria-hidden="true"></i></a>1.&#x6392;&#x5217;,&#x7EC4;&#x5408;&#x7C7B;&#x578B;</h3>
<h4 id="1&#x5168;&#x6392;&#x5217;-ii"><a name="1&#x5168;&#x6392;&#x5217;-ii" class="anchor-navigation-ex-anchor" href="#1&#x5168;&#x6392;&#x5217;-ii"><i class="fa fa-link" aria-hidden="true"></i></a><a name="1&#x5168;&#x6392;&#x5217;-ii" class="plugin-anchor" href="#1&#x5168;&#x6392;&#x5217;-ii"><i class="fa fa-link" aria-hidden="true"></i></a>1.<a href="https://leetcode-cn.com/problems/permutations-ii/" target="_blank">&#x5168;&#x6392;&#x5217; II</a></h4>
<p><img src="https://gitee.com/zisuu/picture/raw/master/img/20201223102128.png" alt="image-20201223102128058"></p>
<p>&#x6211;&#x4EEC;&#x5148;&#x753B;&#x51FA;&#x9012;&#x5F52;&#x6811;:</p>
<p><img src="https://gitee.com/zisuu/picture/raw/master/img/20201223104848.png" alt="image-20201223104847780"></p>
<pre><code class="lang-c++"><span class="hljs-keyword">class</span> Solution {
<span class="hljs-keyword">public</span>:
<span class="hljs-built_in">vector</span>&lt;<span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt;&gt; result;
<span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">bool</span>&gt; flag;
<span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt; num;
<span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">dfs</span><span class="hljs-params">( <span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt; arr,<span class="hljs-keyword">int</span> cur)</span></span>{
    <span class="hljs-keyword">if</span>(cur==num.size()){
        result.push_back(arr);
    }
    <span class="hljs-keyword">if</span>(cur&gt;=num.size())<span class="hljs-keyword">return</span>;
    <span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> i = <span class="hljs-number">0</span>; i &lt; num.size() ; ++i) {
        <span class="hljs-keyword">if</span>( i&gt;<span class="hljs-number">0</span> &amp;&amp; num[i]==num[i<span class="hljs-number">-1</span>]&amp;&amp; ! flag[i<span class="hljs-number">-1</span>])<span class="hljs-keyword">continue</span>;
        <span class="hljs-keyword">if</span>(!flag[i]){
            flag[i]= <span class="hljs-literal">true</span>;
            arr.push_back(num[i]);
            dfs(arr,cur+<span class="hljs-number">1</span>);
            arr.pop_back();
            flag[i]= <span class="hljs-literal">false</span>;
        }
    }
}
<span class="hljs-built_in">vector</span>&lt;<span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt;&gt; permuteUnique(<span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt;&amp; nums) {
    num=nums;
        sort(num.begin(),num.end());
    <span class="hljs-keyword">int</span> size=nums.size();
    flag=<span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">bool</span>&gt;(size, <span class="hljs-literal">false</span>);
    dfs({},<span class="hljs-number">0</span>);
    <span class="hljs-keyword">return</span> result;
}
};
</code></pre>
<h4 id="2&#x5B50;&#x96C6;"><a name="2&#x5B50;&#x96C6;" class="anchor-navigation-ex-anchor" href="#2&#x5B50;&#x96C6;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="2&#x5B50;&#x96C6;" class="plugin-anchor" href="#2&#x5B50;&#x96C6;"><i class="fa fa-link" aria-hidden="true"></i></a>2.<a href="https://leetcode-cn.com/problems/subsets/" target="_blank">&#x5B50;&#x96C6;</a></h4>
<p><img src="https://gitee.com/zisuu/picture/raw/master/img/20201223100519.png" alt="image-20201223100519306"></p>
<p>&#x8BE5;&#x56DE;&#x6714;&#x7B97;&#x6CD5;&#x7684;&#x9012;&#x5F52;&#x6811;:</p>
<p><img src="https://gitee.com/zisuu/picture/raw/master/img/20201223101137.png" alt="image-20201223101137664"></p>
<p>&#x636E;&#x6B64;,&#x6211;&#x4EEC;&#x9700;&#x8981;&#x4E00;&#x4E2A;&#x6307;&#x9488;cur,&#x9009;&#x62E9;&#x5217;&#x8868;&#x53EA;&#x80FD;&#x4ECE;cur&#x5F00;&#x59CB;&#x5F80;&#x540E;</p>
<pre><code class="lang-c++"><span class="hljs-keyword">class</span> Solution {
<span class="hljs-keyword">public</span>:
<span class="hljs-built_in">vector</span>&lt;<span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt;&gt; result;
<span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">dfs</span><span class="hljs-params">(<span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt;nums,<span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt; temp,<span class="hljs-keyword">int</span> cur)</span></span>{
    result.push_back(temp);
    <span class="hljs-keyword">for</span>(<span class="hljs-keyword">int</span> i=cur;i&lt;nums.size();i++){
        temp.push_back(nums[i]);
        dfs(nums,temp,i+<span class="hljs-number">1</span>);
        temp.pop_back();
    }
}
<span class="hljs-built_in">vector</span>&lt;<span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt;&gt; subsets(<span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt;&amp; nums) {
    <span class="hljs-keyword">if</span>(nums.size()==<span class="hljs-number">0</span>)<span class="hljs-keyword">return</span> result;
    dfs(nums,<span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">int</span>&gt;{},<span class="hljs-number">0</span>);
    <span class="hljs-keyword">return</span> result;
}
};
</code></pre>
<h4 id="3&#x7EC4;&#x5408;"><a name="3&#x7EC4;&#x5408;" class="anchor-navigation-ex-anchor" href="#3&#x7EC4;&#x5408;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="3&#x7EC4;&#x5408;" class="plugin-anchor" href="#3&#x7EC4;&#x5408;"><i class="fa fa-link" aria-hidden="true"></i></a>3.<a href="https://leetcode-cn.com/problems/combinations/" target="_blank">&#x7EC4;&#x5408;</a></h4>
<p><img src="https://gitee.com/zisuu/picture/raw/master/img/20201223101500.png" alt="image-20201223101500369"></p>
<p><img src="https://gitee.com/zisuu/picture/raw/master/img/20201223101547.png" alt="image-20201223101547751"></p>
<p>&#x8FD9;&#x9898;&#x548C;&#x5B50;&#x96C6;&#x7684;&#x533A;&#x522B;&#x5728;&#x4E8E;&#x9700;&#x8981;&#x5224;&#x65AD;&#x8FB9;&#x754C;&#x800C;&#x5DF2;</p>
<pre><code>vector&lt;vector&lt;int&gt;&gt; result;
void dfs(vector&lt;int&gt; nums,int cur,int n,int k)
{
    if(nums.size()==k)
    {
        result.push_back(nums);
    }
    if(nums.size()&gt;=k)
        return;
    for(int i=cur;i&lt;=n;i++)
    {
        nums.push_back(i);
        dfs(nums,i+1,n,k);
        nums.pop_back();
    }
}
vector&lt;vector&lt;int&gt;&gt; combine(int n, int k) {
    dfs(vector&lt;int&gt;{},1,n,k);
    return result;
}
</code></pre><h3 id="2&#x89E3;&#x6570;&#x72EC;&#x8FD4;&#x56DE;&#x4E00;&#x6B21;&#x7C7B;&#x578B;"><a name="2&#x89E3;&#x6570;&#x72EC;&#x8FD4;&#x56DE;&#x4E00;&#x6B21;&#x7C7B;&#x578B;" class="anchor-navigation-ex-anchor" href="#2&#x89E3;&#x6570;&#x72EC;&#x8FD4;&#x56DE;&#x4E00;&#x6B21;&#x7C7B;&#x578B;"><i class="fa fa-link" aria-hidden="true"></i></a><a name="2&#x89E3;&#x6570;&#x72EC;&#x8FD4;&#x56DE;&#x4E00;&#x6B21;&#x7C7B;&#x578B;" class="plugin-anchor" href="#2&#x89E3;&#x6570;&#x72EC;&#x8FD4;&#x56DE;&#x4E00;&#x6B21;&#x7C7B;&#x578B;"><i class="fa fa-link" aria-hidden="true"></i></a>2.<a href="https://leetcode-cn.com/problems/sudoku-solver/" target="_blank">&#x89E3;&#x6570;&#x72EC;</a>:&#x8FD4;&#x56DE;&#x4E00;&#x6B21;&#x7C7B;&#x578B;</h3>
<p><img src="https://gitee.com/zisuu/picture/raw/master/img/20201223105035.png" alt="image-20201223105035830"></p>
<p>&#x8FD9;&#x9898;&#x770B;&#x4F3C;&#x5F88;&#x96BE;,&#x4F46;&#x5176;&#x5B9E;&#x548C;&#x524D;&#x9762;&#x7684;&#x56DE;&#x6714;&#x6CA1;&#x6709;&#x592A;&#x5927;&#x7684;&#x533A;&#x522B;</p>
<p>&#x6211;&#x4EEC;&#x5148;&#x6574;&#x7406;&#x4EE5;&#x4E0B;&#x601D;&#x8DEF;:</p>
<p>&#x6211;&#x4EEC;&#x60F3;&#x8981;&#x5728;&#x76D8;&#x4E2D;&#x7684;(i,j)&#x8FD9;&#x4E2A;&#x70B9;&#x586B;&#x6570;&#x5B57;num,&#x5E76;&#x4E14;num&#x8981;&#x6709;&#x8981;&#x6C42;:</p>
<ul>
<li>&#x540C;&#x4E00;&#x884C;&#x4E0D;&#x80FD;&#x91CD;&#x590D;  &#x4E5F;&#x5373;row(i,num)==0</li>
<li>&#x540C;&#x4E00;&#x5217;&#x4E0D;&#x80FD;&#x91CD;&#x590D;   &#x4E5F;&#x5373;col(j,num)==0</li>
<li>&#x540C;&#x4E00;&#x4E2A;3<em>3&#x7684;&#x683C;&#x5B50;&#x4E0D;&#x80FD;&#x91CD;&#x590D; &#x4E5F;&#x5373; box(j/3+(i/3)</em>3)==0</li>
</ul>
<p>&#x6700;&#x540E;,&#x6211;&#x4EEC;&#x53EA;&#x9700;&#x8981;&#x4E00;&#x4E2A;&#x89E3;&#x5373;&#x53EF;,&#x6240;&#x4EE5;&#x5728;&#x505A;&#x51FA;&#x51B3;&#x7B56;&#x7684;&#x56DE;&#x6714;&#x65F6;&#x9700;&#x8981;&#x8FD9;&#x6837;&#x5224;&#x65AD;:</p>
<pre><code>if(dfs(xxxx))
    return true;
</code></pre><p>&#x6700;&#x540E;&#x4EE3;&#x7801;:</p>
<pre><code class="lang-c++"><span class="hljs-keyword">class</span> Solution {
<span class="hljs-keyword">public</span>:
<span class="hljs-keyword">int</span> row[<span class="hljs-number">10</span>][<span class="hljs-number">10</span>]={<span class="hljs-number">0</span>};
<span class="hljs-keyword">int</span> col[<span class="hljs-number">10</span>][<span class="hljs-number">10</span>]={<span class="hljs-number">0</span>};
<span class="hljs-keyword">int</span> box[<span class="hljs-number">10</span>][<span class="hljs-number">10</span>]={<span class="hljs-number">0</span>};
<span class="hljs-keyword">int</span> m,n;
<span class="hljs-function"><span class="hljs-keyword">bool</span> <span class="hljs-title">isOk</span><span class="hljs-params">(<span class="hljs-keyword">int</span> i,<span class="hljs-keyword">int</span> j,<span class="hljs-keyword">int</span> val)</span></span>{
    <span class="hljs-keyword">return</span> i&gt;=<span class="hljs-number">0</span>&amp;&amp;i&lt;m&amp;&amp;j&gt;=<span class="hljs-number">0</span>&amp;&amp;j&lt;n&amp;&amp;!row[i][val]&amp;&amp;!col[j][val]&amp;&amp;!box[j/<span class="hljs-number">3</span>+(i/<span class="hljs-number">3</span>)*<span class="hljs-number">3</span>][val];
}
<span class="hljs-function"><span class="hljs-keyword">bool</span> <span class="hljs-title">dfs</span><span class="hljs-params">(<span class="hljs-built_in">vector</span>&lt;<span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">char</span>&gt;&gt;&amp; board,<span class="hljs-keyword">int</span> i,<span class="hljs-keyword">int</span> j)</span></span>{
    <span class="hljs-comment">//&#x8FB9;&#x754C;&#x5C31;&#x662F;&#x6362;&#x884C;&#x5373;&#x53EF;</span>
    <span class="hljs-keyword">if</span>(j==n){
        j=<span class="hljs-number">0</span>;
        i++;
        <span class="hljs-keyword">if</span>(i==n)<span class="hljs-keyword">return</span> <span class="hljs-literal">true</span>;
    }
    <span class="hljs-keyword">if</span>(board[i][j]==<span class="hljs-string">&apos;.&apos;</span>){
        <span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> k = <span class="hljs-number">1</span>; k &lt;=<span class="hljs-number">9</span> ; ++k) {
            <span class="hljs-keyword">if</span>(isOk(i,j,k)){
                board[i][j]=k+<span class="hljs-string">&apos;0&apos;</span>;
                row[i][k]=<span class="hljs-number">1</span>;
                col[j][k]=<span class="hljs-number">1</span>;
                box[j/<span class="hljs-number">3</span>+(i/<span class="hljs-number">3</span>)*<span class="hljs-number">3</span>][k]=<span class="hljs-number">1</span>;
                <span class="hljs-comment">//&#x6CE8;&#x610F;&#x8FD9;&#x91CC;,&#x53EA;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;&#x89E3;&#x5373;&#x53EF;</span>
                <span class="hljs-keyword">if</span>(dfs(board,i,j+<span class="hljs-number">1</span>))<span class="hljs-keyword">return</span> <span class="hljs-literal">true</span>;
                board[i][j]=<span class="hljs-string">&apos;.&apos;</span>;
                row[i][k]=<span class="hljs-number">0</span>;
                col[j][k]=<span class="hljs-number">0</span>;
                box[j/<span class="hljs-number">3</span>+(i/<span class="hljs-number">3</span>)*<span class="hljs-number">3</span>][k]=<span class="hljs-number">0</span>;
            }
        }
    }<span class="hljs-keyword">else</span>{
        <span class="hljs-keyword">return</span> dfs(board,i,j+<span class="hljs-number">1</span>);
    }
    <span class="hljs-keyword">return</span> <span class="hljs-literal">false</span>;
}
<span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">solveSudoku</span><span class="hljs-params">(<span class="hljs-built_in">vector</span>&lt;<span class="hljs-built_in">vector</span>&lt;<span class="hljs-keyword">char</span>&gt;&gt;&amp; board)</span> </span>{
    m=n=<span class="hljs-number">9</span>;
    <span class="hljs-comment">//&#x5148;&#x9884;&#x8BBE;&#x503C;</span>
    <span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> i = <span class="hljs-number">0</span>; i &lt;m ; ++i) {
        <span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> j = <span class="hljs-number">0</span>; j &lt;n ; ++j) {
            <span class="hljs-keyword">if</span>(board[i][j]!=<span class="hljs-string">&apos;.&apos;</span>){
                <span class="hljs-keyword">int</span> val=board[i][j]-<span class="hljs-string">&apos;0&apos;</span>;
                row[i][val]=<span class="hljs-number">1</span>;
                col[j][val]=<span class="hljs-number">1</span>;
                box[j/<span class="hljs-number">3</span>+(i/<span class="hljs-number">3</span>)*<span class="hljs-number">3</span>][val]=<span class="hljs-number">1</span>;
            }
        }
    }
    dfs(board,<span class="hljs-number">0</span>,<span class="hljs-number">0</span>);
}
};
</code></pre>

<script>console.log("plugin-popup....");document.onclick = function(e){ e.target.tagName === "IMG" && window.open(e.target.src,e.target.src)}</script><style>img{cursor:pointer}</style>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="1.时间复杂度.html" class="navigation navigation-prev " aria-label="Previous page: 1.时间复杂度">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="2.深度优先搜索题目集.html" class="navigation navigation-next " aria-label="Next page: 2.深搜题目集">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"2.深度优先搜索算法","level":"4.3","depth":1,"next":{"title":"2.深搜题目集","level":"4.4","depth":1,"path":"算法/2.深度优先搜索题目集.md","ref":"算法/2.深度优先搜索题目集.md","articles":[]},"previous":{"title":"1.时间复杂度","level":"4.2","depth":1,"path":"算法/1.时间复杂度.md","ref":"算法/1.时间复杂度.md","articles":[]},"dir":"ltr"},"config":{"plugins":["-sharing","splitter","expandable-chapters-small","anchors","sharing-plus","anchor-navigation-ex","favicon","expandable-chapters","toggle-chapters","back-to-top-button","code","-lunr","-search","search-pro","pageview-count","popup","livereload"],"styles":{"website":"./styles/website.css"},"pluginsConfig":{"livereload":{},"splitter":{},"search-pro":{},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"popup":{},"code":{"copyButtons":true},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"anchor-navigation-ex":{"associatedWithSummary":true,"float":{"floatIcon":"fa fa-navicon","level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"mode":"float","multipleH1":true,"pageTop":{"level1Icon":"","level2Icon":"","level3Icon":"","showLevelIcon":false},"printLog":false,"showGoTop":true,"showLevel":false},"favicon":{},"back-to-top-button":{},"pageview-count":{},"expandable-chapters-small":{},"sharing":{"qq":false,"all":["google","facebook","weibo","twitter","qq","qzone","linkedin","pocket"],"douban":false,"facebook":false,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":false,"messenger":false,"line":false,"vk":false,"pocket":false,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"anchors":{},"toggle-chapters":{},"expandable-chapters":{}},"theme":"default","author":"hzh","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"计算机 ,java , 大数据 基础知识体系","language":"zh-hans","gitbook":"3.2.3"},"file":{"path":"算法/2.深度优先搜索.md","mtime":"2020-12-23T03:13:29.857Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-12-30T11:12:56.611Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-toggle-chapters/toggle.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-back-to-top-button/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-pageview-count/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

